package com.igbeok.scheduler.service;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public abstract class AbstractHelloWorldScheduler implements HelloWorldSchedulerInterfaze {

	public AbstractHelloWorldScheduler() {
		System.out.println("=====================");
	}

	private int index = 0;

	/* (non-Javadoc)
	 * @see com.igbeok.scheduler.service.HelloWorldSchedulerInterfaze#sayScheduledHello()
	 */
	@Override
	@Scheduled(cron = "0/3 * * * * *")
	public void sayScheduledHello() {
		System.out.println("Hello World" + index++);
		throw new RuntimeException("Thrown by hand!");
	}

}
